package com.ruoyi.car.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.car.mapper.CarTypeMapper;
import com.ruoyi.car.domain.CarType;
import com.ruoyi.car.service.ICarTypeService;

/**
 * 车辆分类Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-04-07
 */
@Service
public class CarTypeServiceImpl implements ICarTypeService 
{
    @Autowired
    private CarTypeMapper carTypeMapper;

    /**
     * 查询车辆分类
     * 
     * @param id 车辆分类主键
     * @return 车辆分类
     */
    @Override
    public CarType selectCarTypeById(Long id)
    {
        return carTypeMapper.selectCarTypeById(id);
    }

    /**
     * 查询车辆分类列表
     * 
     * @param carType 车辆分类
     * @return 车辆分类
     */
    @Override
    public List<CarType> selectCarTypeList(CarType carType)
    {
        return carTypeMapper.selectCarTypeList(carType);
    }

    /**
     * 新增车辆分类
     * 
     * @param carType 车辆分类
     * @return 结果
     */
    @Override
    public int insertCarType(CarType carType)
    {
        carType.setCreateTime(DateUtils.getNowDate());
        return carTypeMapper.insertCarType(carType);
    }

    /**
     * 修改车辆分类
     * 
     * @param carType 车辆分类
     * @return 结果
     */
    @Override
    public int updateCarType(CarType carType)
    {
        carType.setUpdateTime(DateUtils.getNowDate());
        return carTypeMapper.updateCarType(carType);
    }

    /**
     * 批量删除车辆分类
     * 
     * @param ids 需要删除的车辆分类主键
     * @return 结果
     */
    @Override
    public int deleteCarTypeByIds(Long[] ids)
    {
        return carTypeMapper.deleteCarTypeByIds(ids);
    }

    /**
     * 删除车辆分类信息
     * 
     * @param id 车辆分类主键
     * @return 结果
     */
    @Override
    public int deleteCarTypeById(Long id)
    {
        return carTypeMapper.deleteCarTypeById(id);
    }
}
